<template>
  <div>
    <h1>1. 生命周期</h1>
    <life v-if="show"></life>
    <button @click="show = false">销毁组件</button>
  </div>
</template>

<script>
import life from "./components/Life.vue";
export default {
  data() {
    return {
      show: true,
    };
  },
  components: {
    life,
  },
};
</script>

<style>
</style>